MySQL backup-mysql dump
Back up MySQL directly by using the mysqldump command to back up it to the SQL format. The simplest command is:
mysqldump databasename > bak.sql
The generated bak. SQL content format is as follows:
-- MySQL dum
-uroot-proot--no-data--databases db1 >/tmp/db1.sql7. Export Import data across serversMysqldump--host=h1-uroot-proot--databases db1 |mysql--host=h2-uroot-proot DB2Import all the data from the DB1 database in the H1 server into the DB2 database in H2, and the DB2 database must be present or the error will beAdd the-c parameter to enable compression delivery.8. Append the Binlog location and file name of the main library to the exported data file,--
this way when the profile is turned on. We can see that the SQL file week will have a line--change master to master_log_file= ' current binary log filename ' master_log_pos= event log location ' The next time you back up the data from the binary log, you can back it up from this location in the binary file.--lock-tablesThat means locking all the tables automatically, and if we just back up a single library and lock all the tables, that's unreasonable, we can use this option. Log in to
TcpDump can completely intercept the "Header" of the packets transmitted in the network for analysis. It supports the output results of network... 3. tcpdump. Next we will introduce the configuration and debugging of Linux mysql dump.
1. Linux mysql dump configuration and debugging core file generation switch and size
For Linux mysql dump, pay attention to the following issues to ensure Coredump is generated when the program crashes:
1. For Linux mysql dump, ensure that the directory where Coredump is stored exists and the process has write permission on the directory. The directory that stores Coredump is the current directory of t
Dump can execute functions similar to tar. However, dump tends to consider file systems rather than individual files. This article provides answers to some questions about the Linux mysql dump command.
1. Ensure that the directory for storing Linux mysql
the table:Use library name;CREATE TABLE table name (field settings list);6. Deleting the library and deleting the table:drop database name;drop table name;7. Empty the records in the table:Delete from table name;8. Display the records in the table:SELECT * from table name;MySQL Import Export command1. Export the entire databaseMysqldump-u user name-p database name > exported file nameMysqldump-u wcnc-p SMGP_APPS_WCNC > Wcnc.sql2. Export a tableMysqld
Linux MySQL dump program crashes. Follow the three simple steps below to easily solve the problem.
1. For Linux mysql dump, ensure that the directory where Coredump is stored exists and the process has write permission on the directory. The directory that stores Coredump is the current directory of the process, which
So-today I wanted to learn-to-export a Drupal database to a file quickly. Back on the day I would ' ve logged in through CPanel and navigated to PHPMyAdmin, then manually select an export of the DAT Abase and has to choose where to save the file. Not to mention all the previous steps listed would need to being preceeded by a Drupal cache flush (I don't like the cache in Side a database backup). Typically this would ' ve taken me on 5 minutes to complete, well my friends, no longer are the case.
Tags: http using ar for file Art Div on CWhen using the MySQL command to import mysqldump generated SQL files, in order to improve the import speed, often need to modify the dump file, but in the face of a dozens of GB file, this thing is too broken, the quickest way is to do this:( echo "SET autocommit=0;" echo "SET unique_checks=0;" echo "SET foreign_key_checks=0;" Cat Cc_jiecao.sql echo "S
There is a database online, and there are a lot of records similar to the following in slow log:Copy codeThe Code is as follows:# Time: 130823 13:56:08# User @ Host: repl [repl] @ slave [10. x]# Query_time: 9.000833 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 1SET timestamp = 1377237368;# Administrator command: Binlog Dump; Every time binlog dump is completed, it will be recorded, and it looks very unco
Mysql's dump database command recently used the mysql dump database table to record the usage of this command: www.2cto.com mysqldump backup: mysqldump-u username-p password-h host database a-w "SQL condition" -- lock-all-tables> path case: mysqldump-uroot-p1234-hlocalhost db1 a-w "id in (select id from B)" -- lock-all-tables> c: \ aa.txt mysqldump restore: mysql
Tags: chinese is select query Mon export CTI output sortThe recent need to dump some of MONGODB data to MySQL, previously only bson packets.The initial idea is to use PHP's extension bson_decode directly,Found two tricky questions,
One is the memory consumption problem, if a bson more than 2M, seems to be very laborious.
It is Chinese although appeared, but there will be a lot of special symbo
Tags: like rom creat version requires tag data char lockMethod One: Use the mysqldump command, such as: Mysqldump-h10.90.6.237-uf_insplat2car_r-p3306-pxxxxxxxxx nbmp tb_tag_log--skip-lock-tables-- Set-charset--where= "Origin_chance_no like ' nbcar% '" > Dump.sqlNote that this method will lock the table by default during dump, and the lock table operation requires permission, if there is no lock table permission, you can add the "--skip-lock-tables" op
Java calls Mysql dump to back up the database
SimpleDateFormat sdf = new SimpleDateFormat ("yyyyMMddHHmmss ");
Try {String name = sdf. format (new Date ());String filePath = System. getProperty ("user. dir") + "//" + name + ". SQL ";// System actuatorRuntime rt = Runtime. getRuntime ();// Export Database statementsStringBuffer cmd = new StringBuffer ();Cmd. append ("mysqldump-u ");Cmd. append (ServeConfig.
Label: -u${user---skip-extended-insert--database ${dbname}--table ${tablename} > ${tablename}.sql In the SQL file exported with the above statement, each piece of data is saved according to an INSERT statement, which makes it easy to compare data differences by row with the version comparison tool For example INSERT into' Goods 'VALUES(2,1049600,1,0,'604800:88888:-1:-1:-1:-1:-1|',1464408000,1467019659,0,"'); INSERT into' Goods 'VALUES(4,1049600,1,0,'604800:88888:-1:-1:-1:-1:-1|',1464408000,146
MySQL would truncate any insert value that exceeds the specified column width.The without error try Switch your MySQL mode to the use STRICT.Here some docsEDIT:To change the modeThis can is done in the ways:
Open your "My.ini" file within the MySQL installation directory, and look for the text "Sql-mode".
Find:Code:# Set the SQL mode to strict sql-m
Tags: User name source Create console databaseSeveral common use cases:1. Export the entire databaseMysqldump-u user name-p database name > exported file nameMysqldump-u wcnc-p SMGP_APPS_WCNC > Wcnc.sql2. Export a tableMysqldump-u user name-P database name Table name > exported file nameMysqldump-u wcnc-p SMGP_APPS_WCNC users> wcnc_users.sql3. Export a database structureMysqldump-u Wcnc-p-D--add-drop-table SMGP_APPS_WCNC >d:\wcnc_db.sql-D No data--add-drop-table add a drop table before each CREA
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.